{extend name="public:body" /}

{block name="header"}
  <div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title" style="padding:10px 0;height:30px;">
      <li class="layui-this"><a href="{:url('system/general')}">常规设置</a></li>
    </ul>
  </div>
{/block}
{block name="body"}
<div class="layui-card-body">
  <form class="form-horizontal" action="{:url('general')}" method="post">
    <table class="layui-table table-form" id="menus-table" lay-size="sm">
      <thead>
        <tr>
          <th>名称</th>
          <th>内容</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>微信二维码</td>
          <td>
            <input value="{$wxcode ?? ''}" type="text" name="wxcode" autocomplete="off">
            <button type="button" id="uploads1" class="layui-btn btn-primary layui-btn-sm">
              上传
            </button>
          </td>
        </tr>
        <tr>
          <td>微信账号</td>
          <td>
            <input name="wxzh" type="text" autocomplete="off" value="{$wxzh ?? ''}">
          </td>
        </tr>
        <tr>
          <td>支付宝二维码</td>
          <td>
            <input value="{$zfbcode ?? ''}" type="text" name="zfbcode" autocomplete="off">
            <button type="button" id="uploads2" class="layui-btn btn-primary layui-btn-sm">
              上传
            </button>
          </td>
        </tr>
        <tr>
          <td>支付宝账号</td>
          <td>
            <input name="zfbzh" type="text" autocomplete="off" value="{$zfbzh ?? ''}">
          </td>
        </tr>
        <tr>
          <td>开户行</td>
          <td>
            <input name="bank_name" type="text" autocomplete="off" value="{$bank_name ?? ''}">
          </td>
        </tr>
        <tr>
          <td>银行卡账号</td>
          <td>
            <input name="bank_account" type="text" autocomplete="off" value="{$bank_account ?? ''}">
          </td>
        </tr>
        <tr>
          <td>持卡人姓名</td>
          <td>
            <input name="bank_people" type="text" autocomplete="off" value="{$bank_people ?? ''}">
          </td>
        </tr>
        <tr>
          <td>微信客服</td>
          <td>
            <input name="wxkf" type="text" autocomplete="off" value="{$wxkf ?? ''}">
          </td>
        </tr>
        <tr>
          <td>QQ客服</td>
          <td>
            <input name="qqkf" type="text" autocomplete="off" value="{$qqkf ?? ''}">
          </td>
        </tr>
        <tr>
          <td>统计/客服代码调用</td>
          <td>
            <textarea name="site_code">{$site_code}</textarea>
          </td>
        </tr>
        <tr>
          <td></td>
          <td>
            <button type="button" class="layui-btn btn-primary layui-btn-sm ajax-post">
              保存
            </button>
          </td>
        </tr>
      </tbody>
    </table>
  </form>
</div>

<script>
layui.use('upload', function(){
  var upload = layui.upload

  var uploadInst = upload.render({
    elem: '#uploads1',
    url: "{:url('/uploads')}",
    data: { type: 'site' },
    field: 'file',
    done: function(res) {
      if (res.code === 0) {
        $('[name=wxcode]').val(res.data.src)
      } else {
        layer.msg('上传失败', {icon: 5})
      }
    },
    error: function() {
    }
  })

  var uploadInst = upload.render({
    elem: '#uploads2',
    url: "{:url('/uploads')}",
    data: { type: 'site' },
    field: 'file',
    done: function(res) {
      if (res.code === 0) {
        $('[name=zfbcode]').val(res.data.src)
      } else {
        layer.msg('上传失败', {icon: 5})
      }
    },
    error: function() {
    }
  })
})
</script>
{/block}
